Skip to content

Better ci tests logging for windows#4193

Open
rasapala wants to merge 4 commits into
mainfrom
win_ci_tests
Open

Better ci tests logging for windows#4193
rasapala wants to merge 4 commits into
mainfrom
win_ci_tests

Conversation

@rasapala
Copy link
Copy Markdown
Collaborator

@rasapala rasapala commented May 8, 2026

🛠 Summary

Fixes critical issues in Windows test execution that prevented proper artifact collection and failure reporting:

Changes:

Fix missing win_test_summary.log — Added error handling to ensure summary log is always created, even when grep finds no matches. Previously, grep failure in the pipeline caused the file to not be generated.

Capture pytest exit code correctly — Removed pipe to tee that was masking pytest exit status, preventing pytest import errors from being caught. Now captures exit code before continuing.

Detect testcompletes successfully — Check for "PASSED" marker in full test log. Only perform crash/failure diagnostics if PASSED marker is absent, avoiding unnecessary processing on successful runs.

Improve failure visibility — Display:

Last successful test
Last running test (identifies the failing test regardless of log size)
Output from last running test to end of log (100 lines)
Segfault/crash messages
Apply improvements to CI pipeline — Updated loadWin.groovy with same PASSED marker check before reporting segfault diagnostics.

Add missing pytest.

Impact:

Jenkins now reliably captures test artifacts even on failure
Test failures and segfaults are immediately visible in console output
Easier root cause analysis without needing to inspect full log files

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

@rasapala rasapala requested review from Copilot, dkalinowski and przepeck and removed request for Copilot May 8, 2026 11:57
Copilot AI review requested due to automatic review settings May 11, 2026 10:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to make Windows CI test execution more diagnosable and reliable by improving logging/artifact generation and adding crash/failure context extraction for Jenkins.

Changes:

  • Adjust Windows pytest invocation to preserve the true pytest exit code while still emitting output to the console/log artifact.
  • Enhance Windows test log summarization and add failure/crash diagnostics (last OK/RUN test and trailing log context).
  • Update Jenkins Windows pipeline checks/diagnostics and ensure pytest is installed on Windows agents.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
windows_test.bat Updates pytest logging/exit-code handling; adds summary creation and failure/crash diagnostics for gtest runs.
windows_install_build_dependencies.bat Adds pytest to the Python dependencies installed on Windows nodes.
src/test/ovmsconfig_test.cpp Modifies an existing unit test assertion in OvmsConfigDeathTest.bufferTest.
ci/loadWin.groovy Adds segfault/crash-focused diagnostics when the PASSED marker is not found in the Windows test log.

Comment thread windows_test.bat
Comment on lines +124 to +132
:: Check if tests completed successfully by looking for PASSED marker at the end
grep -q " PASSED " win_full_test.log
if !errorlevel! equ 0 goto :exit_build

:: Tests did not complete successfully - check for failures and segfaults
:: Check if tests failed by looking for FAILED in the full log
grep -q " FAILED " win_full_test.log
if !errorlevel! equ 0 goto :exit_build_error

Comment thread windows_test.bat
Comment on lines +120 to +122
grep -a %regex% win_full_test.log | sed %sed_clean% > win_test_summary.log 2>&1 || (
echo No matching test results found >> win_test_summary.log
)
std::cout << input;
std::string check{buffer.str()};
EXPECT_EQ(input, check);
EXPECT_EQ(input, "ddddd");
if !errorlevel! neq 0 exit /b !errorlevel!
:: setuptools<60.0 required for numpy1.23 on python311 to install
%python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2"
%python_path%\python.exe -m pip install "numpy==2.2.5" "Jinja2==3.1.6" "MarkupSafe==3.0.2" "pytest"
Comment thread ci/loadWin.groovy
Comment on lines 290 to +292
status = bat(returnStatus: true, script: 'grep " PASSED " win_full_test.log')
if (status != 0) {
// Check for segfault/termination only if PASSED is not found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants